package com.abe.bathsystem.widget.dialog;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.Window;
import android.widget.TextView;

import com.abe.bathsystem.entity.http.HttpNoticeEntity;
import com.abe.bathsystem.widget.OnOperateListener;

import net.yet.campusdev.R;

public class ShowNoticeDialog extends BaseDialog {
    private HttpNoticeEntity noticeEntity;

    public ShowNoticeDialog(@NonNull Context context, OnOperateListener operateListener, HttpNoticeEntity noticeEntity) {
        super(context, operateListener);
        this.noticeEntity = noticeEntity;
    }

    public ShowNoticeDialog(@NonNull Context context, HttpNoticeEntity noticeEntity) {
        super(context);
        this.noticeEntity = noticeEntity;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.item_view_show_notice_detail);
        TextView title = findViewById(R.id.item_notice_title);
        TextView content = findViewById(R.id.item_notice_content);
        if (noticeEntity != null) {
            title.setText(noticeEntity.getTitle());
            content.setText(noticeEntity.getBody());
        }
    }
}